/*
 * Simple Node for a Double Linked List
 */

package simplegeneticalgorithm.genogram;

/**
 *
 * @author eherrerag
 */
public class SimpleNode<T> {

    private T data;
    private SimpleNode next;
    private SimpleNode previous;
    private Family sons;

    public SimpleNode(T data_){
        data = data_;
        next = null;
        previous = null;
        sons = null;
    }
    
    public SimpleNode next(){
        return next;
    }
    
    public SimpleNode previous(){
        return previous;
    }
    
    public void next(SimpleNode next_){
        next = next_;
    }
    
    public void previous(SimpleNode previous_){
        previous = previous_;
    }

    @Override
    public String toString(){
        return data.toString();
    }


    public Family sons(){
        return sons;
    }

    public void sons(Family data_){
        sons = data_;
    }

    public void addSon(T data_){
        if (sons != null)
            sons.add(data_);
        else
            sons = new Family(data_);
    }
}
